<?php

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
* @ Moossenger plugin - Joomla CB Plugin
* @ version 0.1
* @ package plug_moossenger
* @ Copyright (C) 2008 by g. henson - All rights reserved
* @ Released under GNU/GPL License - http://www.gnu.org/copyleft/gpl.htm
* @ Website none yet
**/

class getMoossengerTab extends cbTabHandler {
	
	function getMoossengerTab() {
		$this->cbTabHandler();
	}
	
	/**
	* Generates the HTML 
	* @param object tab reflecting the tab database entry
	* @param object mosUser reflecting the user being displayed
	* @param int 1 for front-end, 2 for back-end
	* @returns mixed : either string HTML for tab content, or false if ErrorMSG generated
	*/
	function getDisplayTab($tab,$user,$ui) {
		global $params, $my;
		
		if($my->id!=$user->id && $my->id > 0) {
			$img = '<img src="components/com_comprofiler/plugin/user/plug_moossengertab/images/new_im.gif" />';
			
			$return = '<a href="#" onClick="imManager.create(new User('.$my->id.', \''.$my->username.'\'), new User('.$user->id.',\''.$user->username.'\'));">';
			$return = $return.$img.'</a>';
			
			$mi = array(); 
			$mi["_UE_MENU_STATUS"][$params->get('moosText', "Im")]["Im"]=null;
			$this->addMenu( array(	"position"	=> "menuList" ,
									"arrayPos"	=> $mi ,
									"caption"	=> "" ,
									"url"		=> $return ,
									"target"	=> "" ,
									"img"		=> "" ,
									"alt"		=> "chat" ,
									"tooltip"	=> "instant messanging with this user") );
		}
					
	}
	
}
?>